package com.util.vmwareops;

public class MultiTaskTest implements Runnable
{
    public int count;
    public String vmName;

    String[] destHost = {"531testserver001.bocomdsk.com","531testserver002.bocomdsk.com","531testserver003.bocomdsk.com"};
    String[] destPortGroupMgt = {"DS_139.97.0.x","DS_139.97.200.x_NBU_MNG","DS_139.97.36.x"};
    String[] destDs = {"nfsFromTest001","nfsFromTest003","nfsFromTest005"};
    String vcName = "zjtestvcsa01.bocomdsk.com";

    public MultiTaskTest(String vmName, int count)
    {
        this.vmName = vmName;
        this.count = count;
        System.out.println(this.count);
    }

    @Override
    public void run()
    {
        VmTask vmTask = null;
        try {
            vmTask = new VmTask(vcName);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(Thread.currentThread().getName() + " : " + vmName + " Will Motion to " + destHost[count%3]);
        try {
            vmTask.VMotion(vmName,destHost[count%3],destDs[count%3],
                    "DistributedVirtualPortgroup","DistributedVirtualPortgroup",
                    "DS_QUSTST_182.242.100.x",destPortGroupMgt[count%3]);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
